<div ng-init="init();" class="kmi-layout-content SMT16-content">
    <!-- SMT 產品送修 -->
    <div class="kmi-header-row">
        <div class="kmi-side-btn left" ng-click="back();">
            <i class="material-icons">&#xE408;</i>
            <div class="kmi-can-click"></div>
        </div>
        <div class="header-title" ng-bind="'SMT16.title' | translate"></div>
        <div class="header-logo"></div>
    </div>
    <div class="kmi-layout-main-content">
        <div class="kmi-layout-page">
            <!-- 產品序號 product_serialNumber_panel -->
            <div class="product_serialNumber_panel">
                <div class="kmi-text-fields serialNumber_panel">
                    <label class="label" ng-bind="'SMT16.serial_no' | translate"></label>
                    <input ng-keypress="input_barcode_no($event);" ng-model="barcode_no" id="barcode_no"/>
                    <div class="tip qrcode" ng-click="QRCodeScanner();">
                        <img src="image/icons/QRCode.png">
                    </div>
                    <div class="kmi-button kmi-button-confrim" style="width:100px" ng-click="search()">
                        <label ng-bind="'common.btn.search' | translate"></label>
                        <div class="kmi-can-click"></div>
                    </div>
                    <label class="label" ng-bind="'home.user' | translate"></label>
                    <input class="value" ng-model="data.dispose_user"></input>
                    <div class="tip search"><img src="image/icons/search.png"></img> </div>
                </div>
            </div>
            <!-- 產品基本資料 product_basicData_panel  -->
            <div class="product_basicData_panel" ng-class="[isClose?'is-close':'']">
                <div class="trigger-btn-fields">
                    <div class="close-btn" ng-click="isClose = !isClose">
                        <i class="material-icons closeIcon">remove</i>
                        <i class="material-icons openIcon">add</i>
                        <div class="kmi-can-click" style="z-index: 1;"></div>
                    </div>
                </div>
                <!-- 成品序號列表-->
                <div class="kmi-text-fields kmi-tag-fields" ng-show="data.pcs_list.length>1">
                    <label class="label fixed-width" ng-bind="'SMT16.list1.product_serial_no' | translate"></label>
                    <div class="kmi-button-content">
                        <div class="kmi-button" ng-repeat="pcs in data.pcs_list"
                                ng-click="ChangePCS(pcs)" ng-class="{'is-selected':pcs.pcs_no == pcs_item.pcs_no}">
                            <i class="material-icons">done</i>
                            <label ng-bind="pcs.pcs_no"></label>
                            <div class="kmi-can-click"></div>
                        </div>
                    </div>
                </div>
                <div class="kmi-text-fields" style="padding: 8px 0 0 0;">
                    <!-- 维修序号： -->
                    <div class="kmi-text-fields" style="flex:1">
                        <label class="label fixed-width" ng-bind="'SMT16.list1.barcode' | translate"></label>
                        <label class="value" ng-bind="data.barcode" ng-hide = "hasRecall"></label>
                        <label class="value" ng-bind="data.panel_no" ng-show = "hasRecall"></label>
                    </div>
                    <!-- 序号类型： -->
                    <div class="kmi-text-fields" style="flex:1">
                        <label class="label fixed-width" ng-bind="'SMT16.list1.mode' | translate"></label>
                        <label class="value" ng-bind="'SMT16.list1.product_serial_no' | translate" ng-show="data.mode=='1'"></label>
                        <label class="value" ng-bind="'SMT16.list1.Panel_serial_no' | translate" ng-show="data.mode=='0'"></label>
                    </div>
                    <div class="kmi-text-fields" style="flex:1">
                        <label class="label fixed-width" ng-bind="'SMT16.list1.qty' | translate"></label>
                        <label class="value" ng-bind="data.qty"></label>
                    </div>
                    <!-- 產品序號： -->
                    <!--<label class="label fixed-width" ng-bind="'SMT16.list1.product_serial_no' | translate"></label>
                    <label class="value" ng-bind="pcs_item.pcs_no"></label>-->
                    <!-- Panel序號： -->
                    <!--<label class="label fixed-width" ng-bind="'SMT16.list1.Panel_serial_no' | translate"></label>
                    <label class="value" ng-bind="data.panel_no"></label>-->
                    <!-- 數量： -->
                </div>
                <div class="kmi-text-fields">
                    <!-- 生產批號： -->
                    <label class="label fixed-width" ng-bind="'SMT16.list1.plot_no' | translate"></label>
                    <label class="value" ng-bind="data.plot_no"></label>
                    <!-- 品號： -->
                    <label class="label fixed-width" ng-bind="'SMT16.list1.product_no' | translate"></label>
                    <label class="value" ng-bind="data.product_no"></label>
                    <!-- 規格： -->
                    <label class="label fixed-width" ng-bind="'SMT16.list1.product_spec' | translate"></label>
                    <label class="value" ng-bind="data.item_spec"></label>
                </div>
                <div class="kmi-text-fields">
                    <!-- 作業站： -->
                    <!-- <label class="label fixed-width" ng-bind="'SMT16.list1.op_no' | translate"></label>
                    <label class="value" ng-bind="data.op_no"></label> -->
                    <!-- 工序： -->
                    <div class="kmi-text-fields" style="flex:1">
                        <label class="label fixed-width" ng-bind="'SMT15.list1.smt_op_seq' | translate"></label>
                        <div class="value" ng-bind="data.smt_op_seq+' ( '+ data.smt_op_seqname +' ) '"></div>
                    </div>
                    <!-- 設備(機台)編號： -->
                    <div class="kmi-text-fields" style="flex:1">
                        <label class="label fixed-width" ng-bind="'SMT16.list1.machine_no' | translate"></label>
                        <label class="value" ng-bind="data.machine_no"></label>
                    </div>
                    <!-- 維修次數 -->
                    <div class="kmi-text-fields" style="flex:1">
                        <label class="label fixed-width" ng-bind="'SMT16.list1.maintain_times' | translate"></label>
                        <label class="value" ng-bind="data.maintain_count"></label>
                    </div>
                </div>
                <div class="kmi-text-fields" ng-show="data.pcs_no">
                    <div class="kmi-text-fields" style="flex:1">
                        <!-- 產品序號： -->
                        <label class="label fixed-width" ng-bind="'SMT15.list1.product_no_on_panel' | translate"></label>
                        <label class="value" ng-bind="data.pcs_no"></label>
                    </div>
                </div>
            </div>
            <!-- 產品送修的不良原因 product_repairReason_panel-->
            <div class="product_repairReason_panel" ng-class="[bottom_mode]">
                <div class="kmi-text-fields repairReason_fields" >
                    <div class="repairReason_model" ng-class="{'is_select':bottom_mode == 'select_defectReason'}" ng-click=" bottom_mode = 'select_defectReason'" >
                        <!-- 不良原因 -->
                        <label class="label" ng-bind="'SMT16.defect_reason' | translate"></label>
                    </div>
                    <div class="repairReason_model" ng-class="{'is_select':bottom_mode == 'select_changeComponent'}" ng-click=" bottom_mode = 'select_changeComponent'" >
                        <!-- 更換零件 -->
                        <label class="label" ng-bind="'SMT16.change_component' | translate"></label>
                    </div>
                    <input class="value" ng-model="secord_barcode" style="margin-left: 8px;height: 28px;flex: 0 0 50vw;" ng-keypress="SecordbarcodeScan($event);"></input>
                    <div class="tip qrcode" ng-click="QRCodeScanner('second');">
                        <img src="image/icons/QRCode.png">
                    </div>
                </div>
                <!-- 不良原因的項目 -->
                <div class="kmi-list column-selector init-none ng_defectReason" column-selector-id="" style="border-radius: 0 0 6px 6px;">
                    <div class="kmi-list__header">
                        <div class="kmi-list__column" style="flex: 0 0 40px"></div>
                        <!-- 不良原因編號 -->
                        <div class="kmi-list__column" style="flex: 1;" ng-bind="'SMT16.list2.defect_reason_no' | translate"></div>
                        <!-- 不良原因名稱 -->
                        <div class="kmi-list__column" style="flex: 1;" ng-bind="'SMT16.list2.defect_reason_name' | translate"></div>
                        <!-- 缺點數 -->
                        <div class="kmi-list__column" style="flex: 0 0 64px;" ng-bind="'SMT16.list2.defect_qty' | translate"></div>
                        <!-- 連板位置 -->
                        <div class="kmi-list__column" style="flex: 1;" ng-bind="'SMT16.list2.panelization_position' | translate"></div>
                        <!-- 不良位置(說明) -->
                        <div class="kmi-list__column" style="flex: 1;" ng-bind="'SMT16.list2.defect_position' | translate"></div>
                        <!-- (維修)狀態 -->
                        <div class="kmi-list__column" style="flex: 0 0 60px;" ng-bind="'SMT16.list2.repair_status' | translate"></div>
                    </div>
                    <div class="kmi-list__row-content">
                        <div class="kmi-list__row" ng-repeat="item in item_list">
                            <div class="kmi-list__column column-border" style="flex: 0 0 40px;">
                                <button class="mdl-button mdl-button--icon" ng-click="removeRow(item);">
                                    <img src="image/icons/delete.png"></img>
                                </button>
                            </div>
                            <!-- 不良原因編號 -->
                            <div class="kmi-list__column column-border" style="flex: 1;" ng-bind="item.reason_no"></div>
                            <!-- 不良原因名稱 -->
                            <div class="kmi-list__column column-border" style="flex: 1;" ng-bind="item.reason_name"></div>
                            <!-- 缺點數 -->
                            <div class="kmi-list__column column-input column-border" style="flex: 0 0 64px;">
                                <input mdl-calculater="item.defect_qty" mdl-calculater-decimal="true" readonly="readonly"/>
                            </div>
                            <!-- 連板位置-->
                            <div class="kmi-list__column column-input column-border" style="flex: 1;">
                                <input class="value" ng-model="item.panellization_location"></input>
                            </div>
                            <!-- 不良位置(說明)-->
                            <div class="kmi-list__column column-input column-border" style="flex: 1;">
                                <input class="value" ng-model="item.memo"></input>
                            </div>
                            <!-- (維修)狀態 -->
                            <div class="kmi-list__column column-border" style="flex: 0 0 60px;">
                                <div class="check-point-switch" ng-class="{'is-selected': item.slideBtn == 'true'}" ng-click="slide_btn(item);">
                                    <div style="width:24px;height:24px;"></div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <!-- 更換零件的項目 -->
                <div class="kmi-list column-selector init-none ng_changeComponent" column-selector-id="" style="border-radius: 0 0 6px 6px;">
                    <div class="kmi-list__header">
                        <div class="kmi-list__column" style="flex: 0 0 40px"></div>
                        <!-- (更換)狀態 -->
                        <div class="kmi-list__column" style="flex: 1;" ng-bind="'SMT16.list3.change_status' | translate"></div>
                        <!-- 零件品號 -->
                        <div class="kmi-list__column" style="flex: 1;" ng-bind="'SMT16.list3.component_item_no' | translate"></div>
                        <!-- 零件規格 -->
                        <div class="kmi-list__column" style="flex: 1;" ng-bind="'SMT16.list3.component_spec' | translate"></div>
                        <!-- 批/序號 -->
                        <div class="kmi-list__column" style="flex: 1;" ng-bind="'SMT16.list3.reel_no' | translate"></div>
                        <!-- 數量 -->
                        <div class="kmi-list__column" style="flex: 0 0 64px;" ng-bind="'SMT16.list3.qty' | translate"></div>
                        <!-- 位置 -->
                        <div class="kmi-list__column" style="flex: 1;" ng-bind="'SMT16.list3.position' | translate"></div>
                    </div>
                    <div class="kmi-list__row-content">
                        <div class="kmi-list__row" ng-repeat="item in reel_list">
                            <div class="kmi-list__column column-border" style="flex: 0 0 40px;">
                                <button class="mdl-button mdl-button--icon" ng-click="removeComponent(item);">
                                    <img src="image/icons/delete.png"></img>
                                </button>
                            </div>
                            <!-- (更換)狀態 -->
                            <div class="kmi-list__column column-border" style="flex: 1;" ng-bind="item.pcs_resource_guid?('SMT16.origin' | translate):('SMT16.new' | translate)"></div>
                            <!-- 零件品號 -->
                            <div class="kmi-list__column column-border" style="flex: 1;" ng-bind="item.material_name"></div>
                            <!-- 零件規格 -->
                            <div class="kmi-list__column column-border" style="flex: 1;" ng-bind="item.material_spec"></div>
                            <!-- 批/序號 -->
                            <div class="kmi-list__column column-border" style="flex: 1;" ng-bind="item.reel_no"></div>
                            <!-- 數量 (暫無資料) -->
                            <div class="kmi-list__column column-input column-border" style="flex: 0 0 64px;">
                                <input mdl-calculater="item.qty" mdl-calculater-decimal="true"/>
                            </div>
                            <!-- 位置 (暫無資料) -->
                            <div class="kmi-list__column column-input column-border" style="flex: 1;">
                                <input class="value" ng-model="item.position_no"></input>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!-- 加號按鈕 (開窗) -->
            <div class="btn_panel">
                <button class="mdl-button mdl-js-button mdl-button--icon mdl-button--icon_prime"
                    ng-class="[bottom_mode]" ng-click="AddReason();">
                    <img src="image/icons/add.png"></img>
                </button>
            </div>
        </div>
        <div class="kmi-layout-footer">
            <button class="mdl-button mdl-js-button mdl-button--fab mdl-shadow--custom mdl-button--custom1" ng-click="confirm();">
                <i class="material-icons">done</i>
            </button>
        </div>
    </div>
</div>
